#include "SemanticNodeBlockRelease.h"

/**
 *  @fn	SemanticNodeBlockRelease::SemanticNodeBlockRelease(const SyntaxTreeNode *advanceNodeParent,
 *  	SemanticNode *parent)
 * 
 *  @brief	Constructor. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	advanceNodeParent	If non-null, the advance node parent.
 *  @param	parent				If non-null, the parent.
 */
SemanticNodeBlockRelease::SemanticNodeBlockRelease(const SyntaxTreeNode *releaseNodeParent, SemanticNode *parent) : SemanticNode(parent), LabeledNode(releaseNodeParent->Nodes->GetData(0)) {
	releaseExpression = NULL;
}
/**
 *  @fn	void SemanticNodeBlockRelease::setRelease(SemanticNodeExpression *facility)
 * 
 *  @brief	Sets a release. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	facility	If non-null, the facility.
 */
void SemanticNodeBlockRelease::setRelease(SemanticNodeExpression *facility) {
	releaseExpression = facility;
}
/**
 *  @fn	std::string SemanticNodeBlockRelease::toDebugString(int tab)
 * 
 *  @brief	Converts a tab to a debug string. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	tab	The tab.
 * 
 *  @return	This object as a std::string.
 */
std::string SemanticNodeBlockRelease::toDebugString(int tab) {
	std::ostringstream res;
	for (int i = 0; i < tab; i++) res << DEBUG_STRING_RAZMAK;
	res << getLabelsDebugString() << ": release" << std::endl;
	if (releaseExpression != NULL) res << ((SemanticNode *)(releaseExpression))->toDebugString(tab + 1);
	return res.str();
}
